{extend name="$layout" /}

{block name="top"}
{include file="plugs/nav"}
{/block}

{block name="content"}   

    <form class="form-horizontal" onsubmit="return app.submit(this,'emailsender');" id="ajaxForm" action="" method="post">
        <div class="form-group"><label class="col-sm-2 control-label">接口类型</label>
            <div class="col-sm-10">
            <select class="form-control m-b" name="account" onchange="location.href='?type='+this.value">
                <option value="">=请选择=</option>
                {foreach $plugins as $key=>&$value} 
                    {if condition="$key == $type"}
                        <option value="{$key}" selected = "selected">{$value['shortdescription']}</option>
                    {else /}
                        <option value="{$key}">{$value['shortdescription']}</option>
                    {/if}
                {/foreach} 
            </select> 
            </div>
        </div>
        {foreach $data as $key=>$value} 
        <div class="form-group"><label class="col-sm-2 control-label">{$key}</label>
            <div class="col-sm-10">
            {if condition="is_bool($value)"}
                <input name="{$key}" type="checkbox" {if condition="$value==1"}checked="true" value="true"{else /}value="false"{/if}>
            {else /}
                <input value="{$value}" name="{$key}" type="text" class="form-control">
            {/if}  
            </div>
        </div> 
        {/foreach}  
        <div class="form-group">
            <div class="col-sm-4 col-sm-offset-2">
                <button class="btn btn-primary" type="submit">修改</button>
                <input type="hidden" name="type" value="{$type}">
            </div>
        </div>
    </form>
    <div class="hr-line-dashed"></div>
        <form class="form-horizontal" onsubmit="return app.submit(this,'emailtest');" id="dtest" action="" method="post">
        <div class="form-group"><label class="col-sm-2 control-label">邮件</label>
            <div class="col-sm-10">
                <input value="" name="testemail" type="text" class="form-control">
            </div>
        </div> 
        <div class="form-group"><label class="col-sm-2 control-label">内容</label>
            <div class="col-sm-10">
                <textarea name="testcontent" class="form-control"></textarea>
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-4 col-sm-offset-2">
                <button class="btn btn-primary" type="submit">测试</button>
                 
            </div>
        </div>
        </form>
{/block}